// 职位信息管理
export const PositionInfoThead = [
  // {
  //   type: 'selection',
  //   width: 60,
  //   align: 'center'
  // },
  {
    title: '职位编码',
    key: 'code'
  },
  {
    title: '职位名称',
    key: 'name'
  },
  {
    title: '所属部门',
    key: 'departmentName'
  },
  {
    title: '上级职位',
    key: 'parentName'
  },
  {
    title: '是否主管职位',
    key: 'type',
    render: (h, params) => {
      const text = params.row.type == 0 ? '否' : '是'
      return h('span', text)
    }
  },
  {
    title: '职位状态',
    key: 'enabled',
    render: (h, params) => {
      const text = params.row.enabled ? '启用' : '禁用'
      return h('span', text)
    }
  },
  {
    title: '操作',
    width: 320,
    align: 'center',
    key: 'action',
    slot: 'action'
  }
]

// 职位信息汇总
export const PositionSummaryInfoThead = [
  // {
  //   type: 'selection',
  //   width: 60,
  //   align: 'center'
  // },
  {
    title: '职位编码',
    key: 'code'
  },
  {
    title: '职位名称',
    key: 'name'
  },
  {
    title: '所属部门',
    key: 'departmentName'
  },
  {
    title: '上级职位',
    key: 'parentName'
  },
  {
    title: '是否主管职位',
    key: 'type',
    render: (h, params) => {
      const text = params.row.type == 0 ? '否' : '是'
      return h('span', text)
    }
  },
  {
    title: '职位状态',
    key: 'enabled',
    render: (h, params) => {
      const text = params.row.enabled ? '启用' : '禁用'
      return h('span', text)
    }
  }
]

// 员工信息汇总
export const EmployeeSummaryInfoThead = [
  // {
  //   type: 'selection',
  //   width: 60,
  //   align: 'center'
  // },
  {
    title: '账号名称',
    key: 'name'
  },
  {
    title: '登录名称',
    key: 'userName'
  },
  {
    title: '手机号码',
    key: 'phone'
  },
  {
    title: '所属职位',
    key: 'positionName'
  },
  {
    title: '所属部门',
    key: 'departmentName'
  },
  {
    title: '所属公司',
    key: 'companyName'
  },
  {
    title: '用户状态',
    key: 'enabled',
    render: (h, params) => {
      const text = params.row.enabled ? '启用' : '禁用'
      return h('span', text)
    }
  },
  {
    title: '创建时间',
    key: 'createdOn',
    render: (h, params) => {
      let row = params.row
      let times = ''
      if (row.createdOn) {
        times = row.createdOn.slice(0, 19).replace(/T/g, ' ')
      }
      return h('span', times)
    }
  }
]

// 历史调整信息
export const HistoryAdjustThead = [
  // {
  //   type: 'selection',
  //   width: 60,
  //   align: 'center'
  // },
  {
    title: '调整类型',
    key: 'logTypeName'
  },
  {
    title: '调整类型',
    key: 'changeTypeName'
  },
  {
    title: '职位名称',
    key: 'name'
  },
  {
    title: '调整前所属部门',
    key: 'beforeChange'
  },
  {
    title: '调整后所属部门',
    key: 'afterChange'
  },
  {
    title: '修改信息名称',
    key: 'changeTypeName'
  },
  {
    title: '修改前内容',
    key: 'beforeChange'
  },
  {
    title: '修改后内容',
    key: 'afterChange'
  },
  {
    title: '生效日期',
    key: 'effectTime',
    render: (h, params) => {
      let row = params.row
      let times = ''
      if (row.effectTime) {
        times = row.effectTime.slice(0, 10).replace(/T/g, ' ')
      }
      return h('span', times)
    }
  },
  {
    title: '操作人',
    key: 'createdName'
  },
  {
    title: '操作时间',
    key: 'createdOn',
    render: (h, params) => {
      let row = params.row
      let times = ''
      if (row.createdOn) {
        times = row.createdOn.slice(0, 19).replace(/T/g, ' ')
      }
      return h('span', times)
    }
  }
]

// 绑定账号
export const accountBindThead = [
  {
    type: 'selection',
    width: 60,
    align: 'center'
  },
  {
    title: '账号名称',
    key: 'name',
    width: 150
  },
  {
    title: '登录名称',
    key: 'userName',
    width: 200
  },
  {
    title: '手机号码',
    key: 'phone',
    width: 150
  },
  {
    title: '所属职位',
    key: 'positionName',
    width: 150
  },
  {
    title: '所属部门',
    key: 'departmentName',
    width: 150
  },
  {
    title: '所属公司',
    key: 'companyName',
    width: 150
  },
  {
    title: '用户状态',
    key: 'enabled',
    width: 150,
    render: (h, params) => {
      const text = params.row.enabled ? '启用' : '禁用'
      return h('span', text)
    }
  },
  {
    title: '创建时间',
    key: 'createdOn',
    width: 180,
    render: (h, params) => {
      let row = params.row
      let times = ''
      if (row.createdOn) {
        times = row.createdOn.slice(0, 19).replace(/T/g, ' ')
      }
      return h('span', times)
    }
  }
]
